{% extends "template/listEdit.volt" %}

{% block title %}维修记录{% endblock %}

{% block filter %}

    <div class="col-md-4 col-sm-6 col-xs-12">
        <table>
            <tr>
                <th>ID:</th>
                <td><input type="text" name="id" value=""></td>
            </tr>
            <tr>
                <th>是否在质保期内:</th>
                <td><select name="isquality">
                        <option value="">请选择</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select></td>
            </tr>
        </table>
    </div>
    <div class="col-md-4 col-sm-6 col-xs-12">
        <table>
            <tr>
                <th>飞机编号:</th>
                <td><input type="text" name="uas_serial_id" value=""></td>
            </tr>

        </table>
    </div>
    <div class="col-md-4 col-sm-6 col-xs-12">
        <table>
            <tr>
                <th>更新时间:</th>
                <td><input type="date-h" name="created_at_start" data-attr="date"
                           value="">-<input type="date-h" name="created_at_end" data-attr="date right" class="end"
                                            value=""></td>
            </tr>
            <tr>
                <td colspan="2">
                    <div id="btn_reset_param" class="btn-0 button">清 空</div>
                    <div id="btn_search_data" class="btn-1 button">过 滤</div>
                </td>
            </tr>
        </table>
    </div>

{% endblock %}
{% block hiddenCheckAll %}hidden{% endblock %}
{% block hiddenDeleteAll %}hidden{% endblock %}
{% block hiddenContent %}

{% endblock %}
{% block jscontent %}
    <script>
        var isGetMode=false;

        function clickDetail(result){
            if(isGetMode){
                window.parent.childrenCallBack(result);
            }else{
                PageDataProxy.actionDetail(result)
            }
        }

        $(function () {
            var myDate = new Date();
            $(".current-time").attr("value", myDate.toLocaleDateString());
            isGetMode=getQueryString("isGet");
            PageDataProxy.init({
                "action_detail_url": "/factory/detailFixRecord",
                "url": "/factory/reportFixRecord",
                "table_id": "#mytable",
                "page_control_id": "#data-wrap",
                "page_size_id": "#rows-perpage-select",
                "page_total_id": "#data_count_total",
                "use_check_box": false,
                "data_field_process": function (name, value) {
                    if (name == "company") {
                        return PageDataProxy.formatShortContent(value, 18);
                    }

                    if(name=="id"){
                        return "<a href='javascript:void(0)' onclick=clickDetail('id=" + value + "')>" + value + "</a>";;
                    }
                    return value;
                },
                "table_style": {
                    "id": "width-s",
                    "upload_user_id": "width-s",
                    "uas_serial_id": "width-m",
                    "delivery_at": "width-m",
                    "fix_at": "width-m",
                    "quality_time": "width-m",
                    "accident_report_url": "width-s",
                    "accident_record_url": "width-s",
                    "fix_record_url": "width-m",
                    "oqc_url": "width-s",
                    "flight_test_url": "width-s",
                    "created_at": "width-m"
                },
                "data_field_action_process": function (tag) {
                    return "<td onclick=PageDataProxy.actionDetail('id=" + tag + "')><img class='action-show-icon'>详细</td>";
                    //return "<td onclick='actionDetail(" + tag + ")'><img class='action-show-icon'>详细</td>";
                },
            });
            $("#btn_reset_param").click(function () {
                $("#drone-filter input").each(function () {
                    $(this).val("");
                });
            });
            $("#btn_search_data").click(function () {
                PageDataProxy.refresh();
            });
        })
    </script>
{% endblock %}